package com.ruitu.mall_98_2.mvp.model;

import com.ruitu.mall_98_2.dao.APIRetrofit;
import com.ruitu.mall_98_2.mvp.contract.OrderDetailsContract;
import com.ruitu.router_module.bean.api.BaseResult;
import com.ruitu.router_module.bean.order.OrderDetail;

import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

public class OrderDetailsModel implements OrderDetailsContract.Model {
    @Override
    public Observable<BaseResult<OrderDetail>> orderDetailsInfo(String orderId) {
        return APIRetrofit.getDefault().orderDetailsInfo(orderId)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io());
    }

    @Override
    public Observable<BaseResult> qrsh(String odId) {
        return APIRetrofit.getDefault().qrsh(odId)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io());
    }

    @Override
    public Observable<BaseResult> deleteOrder(String orderId) {
        return APIRetrofit.getDefault().deleteOrder(orderId)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io());
    }

    @Override
    public Observable<BaseResult<String>> invitationCollage(String goodsId) {
        return APIRetrofit.getDefault().invitationCollage(goodsId)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io());
    }

}
